from impala.dbapi import connect

def create_conn(db_name):
    return connect(host='master', port=10000,database=db_name,auth_mechanism='NOSASL')

def query_data(conn, table_name):
    cursor = conn.cursor()
    cursor.execute('select * from ' + table_name)
    results = cursor.fetchall()
    for table in results:
        print(table)


if __name__ == '__main__':
    db_name = 'default'
    table_name = 'table1'
    conn = create_conn(db_name)
    query_data(conn, table_name)